package com.iqiyi.pps.epg.web.service.cloudpush;

import com.alibaba.fastjson.JSONObject;
import com.iqiyi.kiwi.utils.Configuration;
import com.iqiyi.pps.epg.core.utils.ApiHttpRequestUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Created by zhang on 2016/2/2.
 */
public class HttpCloudPushService {

    private static Logger logger = LoggerFactory.getLogger(HttpCloudPushService.class);

    private static final String CLOUD_PUSH_URL = Configuration.getString("http.cloudPush.url", "http://cloudpush.qiyi.domain/apis/push/inner/message/push_to_devices.action");

    public static JSONObject pushToDevices(Map<String, Object> params) {
        JSONObject response = null;
        if (params == null || params.keySet().size() <= 0) {
            return response;
        }
        response = ApiHttpRequestUtil.postMethod(CLOUD_PUSH_URL, null, params, 3000);
        return response;
    }
}
